package com.ddxz.flink

import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.scala._

object Hello {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val ds = env.readTextFile("D:\\move\\apache-maven-3.6.3\\conf\\settings.xml")
      .flatMap { _.toLowerCase.split("\\W+") filter { _.nonEmpty } }
      .map { (_, 1) }
      .keyBy(_._1)
//      .timeWindow(Time.seconds(1))
      .sum(1)
      .print()

    env.execute("Hello")
  }
}
